package com.ctshk.common.enums.hotel;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

/**
 * @author 谢诗宏
 * @description 酒店星级等级
 * @date 2021/3/11
 */
@AllArgsConstructor
public enum HotelStarLevel {

    // 酒店所有星级
    TWO(2, "二星级及以下"),
    THREE(3, "三星级/舒适型"),
    FOUR(4, "四星级/高档型"),
    FIVE(5, "五星级/豪华型");

    @Getter
    @Setter
    private int code;

    @Getter
    @Setter
    private String value;

    public static String parseValue(int code){
        for (HotelStarLevel type : HotelStarLevel.values()) {
            if (type.code == code) {
                return type.getValue();
            }
        }
        return null;
    }
}
